home *** CD-ROM | disk | FTP | other *** search
/ Aminet 16 / Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso / Aminet / misc / emu / QDOS2.lha / QLsource / ROMsrc / SYS / DBUGTBLS_asm < prev    next >
Text File  |  1995-07-06  |  6KB  |  289 lines

  1. */beginfile DBUGTBLS_asm
  2. ; --------------------------------------------------------------
  3. ; DBUGTBLS_asm - QDOS debugging messages
  4. ;          - last modified 23/05/94
  5. ; QDOS-Amiga sources by Rainer Kowallik
  6. ;    ...latest changes by Mark J Swift
  7. ; --------------------------------------------------------------
  8. ;*/beginoverlay
  9.  
  10. ; -------------------------------------------------------------
  11. ;    print long word d0.l as HEX to channel with id a0
  12.  
  13. HEX20:
  14.     swap    d0
  15.     bsr    HEX10
  16.     swap    d0
  17.     bsr    HEX10
  18.     rts
  19.  
  20. ; -------------------------------------------------------------
  21. ;    print word d0.w as HEX to channel with id a0
  22.  
  23. HEX10:
  24.     ror.w    #8,d0
  25.     bsr    HEX08
  26.     rol.w    #8,d0
  27.     bsr    HEX08
  28.     rts
  29.  
  30. ; -------------------------------------------------------------
  31. ;    print byte d0.b as HEX to channel with id a0
  32.  
  33. HEX08:
  34.     ror.b    #4,d0
  35.     bsr    HEX04
  36.  
  37.     rol.b    #4,d0
  38.     bsr    HEX04
  39.  
  40.     rts
  41.  
  42. ; -------------------------------------------------------------
  43. ;    print nibble d0.b as HEX to channel with id a0
  44.  
  45. HEX04:
  46.     movem.l    d0/a1,-(a7)
  47.  
  48.     and.b    #$F,d0
  49.     add.b    #'0',d0
  50.     cmp.b    #'9',d0
  51.     ble.s    HEX04a
  52.     add.b    #7,d0
  53.  
  54. HEX04a:
  55.     asl.w    #8,d0
  56.     move.w    d0,-(a7)
  57.     move.w    #1,-(a7)
  58.     move.l    a7,a1
  59.     bsr    IOSTRG
  60.     addq    #4,a7
  61.  
  62.     movem.l    (a7)+,d0/a1
  63.     rts
  64.  
  65. ; -------------------------------------------------------------
  66. ;    print string at (a1) to channel with id a0
  67.  
  68. IOSTRG:
  69.     movem.l    d0-d3/a1-a2,-(a7)
  70.  
  71.     moveq    #-1,d3        ; time-out
  72.     move.w    (a1)+,d2     ; get length
  73.     moveq    #IO.SSTRG,d0
  74.     andi    #$F8FF,sr    ; enable interrupts
  75.     trap    #3        ; send string
  76.  
  77.     tst.l    d0
  78.     beq.s    IOSTRGX
  79.  
  80.     move.l    BV_CHBAS(a6),d1    ; get ptr to BASICs # table
  81.     move.l    #-1,0(a6,d1.l)    ; otherwise close BASICs' #0
  82.     moveq    #IO.CLOSE,d0
  83.     trap    #2        ; close channel
  84.     bsr    CH_ZERO
  85.  
  86. IOSTRGX:
  87.     movem.l    (a7)+,d0-d3/a1-a2
  88.     rts
  89.  
  90. ; --------------------------------------------------------------
  91. ;  Find channel ID of BASICs #0 - open a CON if #0 is closed
  92. ;
  93. ;  return A6 = BASICs A6
  94. ;     A5 = Address of system variables
  95. ;     A4 = JCB of JOB
  96. ;     D6 = JOBs RELA6 flag
  97.  
  98. CH_ZERO:
  99.  
  100.     move.l    a7,d0        ; Calculate start of
  101.     andi.w    #-$8000,d0    ; system variables
  102.     move.l    d0,a5
  103.  
  104.     move.l    SV_JBBAS(a5),a4    ; Pointer to base of job table
  105.     move.l    (a4),a4        ; JCB of BASIC
  106.     lea    JB_END(a4),a6    ; get BASICs A6
  107.  
  108.     move.l    SV_JBPNT(a5),a4    ; Ptr to entry in JOB table
  109.     move.l    (a4),a4        ; JCB of current JOB
  110.  
  111.     move.b    JB_RELA6(a4),d6    ; save JB_RELA6
  112.     bclr    #7,JB_RELA6(a4)    ; addresses not a6 relative
  113.  
  114. CH_ZERLUP:
  115.     move.l    BV_CHBAS(a6),d0    ; get ptr to BASICs # table
  116.     move.l    0(a6,d0.l),d0    ; get ID for #0
  117.  
  118.     bge.s    NO_PANIK     ; branch if #0 open
  119.  
  120.     lea    WIN_MON0(pc),a1    ; otherwise open #0 afresh
  121.     moveq    #0,d4
  122.     bsr    OPEN_CON_asd4
  123.  
  124.     bra.s    CH_ZERLUP    ; ...try again
  125.  
  126. NO_PANIK:
  127.     move.l    d0,a0        ; return with ID in a0
  128.  
  129.     rts
  130.  
  131. ; -------------------------------------------------------------
  132. ;    find keyboard queue for channel a0
  133.  
  134. ;    entry: a0 = channel
  135. ;       a5 = sys vars
  136. ;    exit:  a2 = Q for channel or zero.
  137.  
  138. CH_KEYQ:
  139.     sub.l    a2,a2        ; assume no Q
  140.  
  141.     movea.l    SV_CHBAS(a5),a3    ; Ptr to base of chan tabl
  142.     move.l    a0,d0
  143.     asl.w    #2,d0
  144.     move.l    0(a3,d0.w),d0    ; pointer to chan def block
  145.  
  146.     blt.s    CH_KQX        ; exit if #0 is closed
  147.  
  148.     movea.l    d0,a3
  149.     move.l    (a3),a1        ; length of chan
  150.     add.l    a3,a1        ; addr of end of chan def
  151.  
  152.     move.l    SV_KEYQ(a5),d0
  153.     beq.s    CH_KQX        ; exit if no Q's
  154.  
  155.     move.l    d0,a2        ; current Q to d1
  156.  
  157. CH_KQLUP:
  158.     cmp.l    a3,a2        ; check if Q is within
  159.     blt.s    CH_KQNXT     ; current chan def block
  160.  
  161.     cmp.l    a2,a1
  162.     bgt.s    CH_KQX        ; ...and exit if so
  163.  
  164. CH_KQNXT:
  165.     movea.l    (a2),a2        ; next queue
  166.  
  167.     cmpa.l    SV_KEYQ(a5),a2    ; Current key Q
  168.     bne.s    CH_KQLUP     ; next Q <> this Q
  169.  
  170.     sub.l    a2,a2        ; ...eek, not in list
  171.  
  172. CH_KQX:
  173.     move.l    a2,d0        ; set flags
  174.     rts
  175.  
  176. ; --------------------------------------------------------------
  177. TXTC    DC.B    0,11,'CODE error ',0
  178.  
  179. TXTR    DC.B    0,11,'READ error ',0
  180. TXTW    DC.B    0,12,'WRITE error '
  181.  
  182. TXTI    DC.B    0,26,'processing INSTRUCTION in '
  183. TXTX    DC.B    0,24,'processing EXCEPTION in '
  184.  
  185. TXTTBL    DC.W    TXTUNK-TXTUDS,TXTUDS-TXTUDS,TXTUPS-TXTUDS,TXTUNK-TXTUDS
  186.     DC.W    TXTUNK-TXTUDS,TXTSDS-TXTUDS,TXTSPS-TXTUDS,TXTACK-TXTUDS
  187.  
  188. TXTUDS    DC.B    0,10,'USER DATA '
  189. TXTUPS    DC.B    0,13,'USER PROGRAM ',0
  190. TXTSDS    DC.B    0,16,'SUPERVISOR DATA '
  191. TXTSPS    DC.B    0,19,'SUPERVISOR PROGRAM ',0
  192. TXTACK    DC.B    0,22,'INTERRUPT ACKNOWLEDGE '
  193. TXTUNK    DC.B    0,8,'UNKNOWN '
  194.  
  195. TXTG    DC.B    0,11,'at ADDRESS ',0
  196. TXTH    DC.B    0,19,' after INSTRUCTION ',0
  197.  
  198. TXTSR:
  199.     DC.B    0,3,'SR=',0
  200. TXTPC:
  201.     DC.B    0,4,' PC='
  202.  
  203. TXTREG1:
  204.     DC.B    0,6,10,'d0-d7'
  205. TXTREG2:
  206.     DC.B    0,6,10,'a0-a7'
  207.  
  208. TXTREGD:
  209.     DC.B    0,1,'d',0
  210. TXTREGA:
  211.     DC.B    0,1,'a',0
  212. TXTEQU:
  213.     DC.B    0,1,'=',0
  214. TXTSPC:
  215.     DC.B    0,1,' ',0
  216. TXTRTN:
  217.     DC.B    0,1,10,0
  218.  
  219. TXTTMSG:
  220.     DC.B    0,15,'VECTOR OFFSET: ',0
  221.  
  222. TXTTTBL:
  223.     DC.W    TXT00-TXT00,TXT04-TXT00,TXT08-TXT00,TXT0C-TXT00
  224.     DC.W    TXT10-TXT00,TXT14-TXT00,TXT18-TXT00,TXT1C-TXT00
  225.     DC.W    TXT20-TXT00,TXT24-TXT00,TXT28-TXT00,TXT2C-TXT00
  226.  
  227. TXT00:
  228.     DC.B    0,4,'(??)'
  229. TXT04:
  230.     DC.B    0,7,'(RESET)',0
  231. TXT08:
  232.     DC.B    0,11,'(BUS ERROR)',0
  233. TXT0C:
  234.     DC.B    0,15,'(ADDRESS ERROR)',0
  235. TXT10:
  236.     DC.B    0,21,'(ILLEGAL INSTRUCTION)',0
  237. TXT14:
  238.     DC.B    0,21,'(ZERO DIVIDE IN CODE)',0
  239. TXT18:
  240.     DC.B    0,20,'(UNDEFINED CHK TRAP)'
  241. TXT1C:
  242.     DC.B    0,25,'(TRAPV, TRAPcc, cpTRAPcc)',0
  243. TXT20:
  244.     DC.B    0,21,'(PRIVILEGE VIOLATION)',0
  245. TXT24:
  246.     DC.B    0,7,'(TRACE)',0
  247. TXT28:
  248.     DC.B    0,8,'(LINE-A)'
  249. TXT2C:
  250.     DC.B    0,8,'(LINE-F)'
  251.  
  252. TXTFMSG:
  253.     DC.B    0,13,'FORMAT CODE: ',0
  254.  
  255. TXTFTBL:
  256.     DC.W    TXT0000-TXT0000,TXT0001-TXT0000,TXT0010-TXT0000,TXTUNKN-TXT0000
  257.     DC.W    TXTUNKN-TXT0000,TXTUNKN-TXT0000,TXTUNKN-TXT0000,TXTUNKN-TXT0000
  258.     DC.W    TXTUNKN-TXT0000,TXT1001-TXT0000,TXT1010-TXT0000,TXT1011-TXT0000
  259.     DC.W    TXTUNKN-TXT0000,TXTUNKN-TXT0000,TXTUNKN-TXT0000,TXTUNKN-TXT0000
  260.  
  261. TXT0000:
  262.     DC.B    0,9,' (4-WORD)',0
  263. TXT0001:
  264.     DC.B    0,12,' (THROWAWAY)'
  265. TXT0010:
  266.     DC.B    0,9,' (6-WORD)',0
  267. TXT1001:
  268.     DC.B    0,22,' (C/P MID-INSTRUCTION)'
  269. TXT1010:
  270.     DC.B    0,24,' (SHORT BUS CYCLE FAULT)'
  271. TXT1011:
  272.     DC.B    0,23,' (LONG BUS CYCLE FAULT)',0
  273. TXTUNKN:
  274.     DC.B    0,10,' (UNKNOWN)'
  275. TNAME:
  276.     DC.B    0,10,'Flp1_TRACE'
  277.  
  278. ; --------------------------------------------------------------
  279. IPC9:
  280.     DC.B    $09
  281.     DC.B    $01
  282.     DC.L    $00000000
  283.     DC.B    $01
  284.     DC.B    $02
  285.  
  286. ;*/endoverlay
  287. ; --------------------------------------------------------------
  288. ;*/endfile
  289.